package com.neutech.demo.day04;

public class Recursion {
    public static void main(String[] args) {
    double sum = sum(100);
        System.out.println(sum);
    }
    //前100项和
    public static double sum(int n){
        if (n == 1){
            return 1;
        }
        return 1.0/n + sum(n-1);
    }
}
